// Test script for WecomMessenger functionality
require('dotenv').config(); // Load environment variables
const WecomMessenger = require('./utils/wecomMessenger');

async function testWecomMessage() {
    try {
        console.log('Sending test message to verify WecomMessenger functionality...');
        
        const testMessage = `
测试消息 - Test Message
------------------------
时间：${new Date().toLocaleString()}
环境：${process.env.NODE_ENV || 'development'}
------------------------
如果您收到此消息，表示WecomMessenger配置正确。
If you received this message, WecomMessenger is configured correctly.`;
        
        // Send test message - using same user ID as in your crawler code
        await WecomMessenger.sendMessage({
            touser: "1000131",
            content: testMessage
        });
        
        console.log('Test message sent successfully!');
    } catch (error) {
        console.error('Error sending test message:', error);
    }
}

// Execute the test
testWecomMessage(); 